package routers

import (
	"github.com/EDDYCJY/go-gin-example/routers/api/v1"
	"github.com/gin-gonic/gin"

	"github.com/EDDYCJY/go-gin-example/pkg/setting"
)

func InitRouter() *gin.Engine {
	r := gin.New()

	r.Use(gin.Logger())

	r.Use(gin.Recovery())

	gin.SetMode(setting.RunMode)

	//r.GET("/test", func(c *gin.Context) {
	//	c.JSON(200, gin.H{
	//		"message": "test",
	//	})
	//})
	apiV1 := r.Group("/api/v1")
	{
		//apiV1.GET("/tags",v1.GetTags)
		//apiV1.POST("/tags",v1.AddTags)
		apiV1.GET("/query", v1.Query)
	}

	return r
}
